<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Title</title>
	<script type="text/javascript" src="./plugins/vue/dist/vue.min.js"></script>
	<script type="text/javascript" src="./plugins/axios/dist/axios.min.js"></script>
	<script type="text/javascript" src="./js/common.js"></script>
</head>
<body>
<div id="app">
	<h1>用户信息验证，请耐心等待</h1>
</div>
</body>
<script type="text/javascript">
    new Vue({
        el: "#app",
        mounted(){
            //要获取授权码
			let param = getParam();
            //处理回调方法
			this.$http.post("/wechat2/handleCallBackMethod",param)
				.then(res=>{
					let {success, msg, resultObject} = res.data;

					if(success&&resultObject.openid) {
					    location.href="/binder.html?openid="+resultObject.openid
					} else if(success&&resultObject.loginUser&&resultObject.token) {
					    localStorage.setItem("loginUser",json.stringify(resultObject.loginUser));
					    localStorage.setItem("token",resultObject.token)
						location.href="/index.html"
					} else {
					    alert(msg)
					}

				})


        }
    });
</script>
</html>